projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dda06a4
)
sf: sandbox: Use JEDEC_MFR|ID in id exctract
author
Jagan Teki
<
[email protected]
>
Sun, 30 Oct 2016 17:46:12 +0000
(23:16 +0530)
committer
Jagan Teki
<
[email protected]
>
Fri, 18 Nov 2016 07:34:52 +0000
(13:04 +0530)
Instead of extracting id's separately better
to use JEDEC_MFR|ID for code simplicity.
Cc: Bin Meng <
[email protected]
>
Signed-off-by: Jagan Teki <
[email protected]
>
Reviewed-by: Simon Glass <
[email protected]
>
Reviewed-by: Jagan Teki <
[email protected]
>
Tested-by: Jagan Teki <
[email protected]
>
drivers/mtd/spi/sandbox.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/spi/sandbox.c
b/drivers/mtd/spi/sandbox.c
index d68ee4a293b71196b7842ed543d8b35efbb54e98..09ce7837ea9e3d75e5b23a730a02c227e8d9d160 100644
(file)
--- a/
drivers/mtd/spi/sandbox.c
+++ b/
drivers/mtd/spi/sandbox.c
@@
-359,9
+359,8
@@
static int sandbox_sf_xfer(struct udevice *dev, unsigned int bitlen,
debug(" id: off:%u tx:", sbsf->off);
if (sbsf->off < IDCODE_LEN) {
/* Extract correct byte from ID 0x00aabbcc */
- id = ((((sbsf->data)->id[0]) << 16) |
- (((sbsf->data)->id[1]) << 8 |
- ((sbsf->data)->id[2]))) >>
+ id = ((JEDEC_MFR(sbsf->data) << 16) |
+ JEDEC_ID(sbsf->data)) >>
(8 * (IDCODE_LEN - 1 - sbsf->off));
} else {
id = 0;